namespace CSharpPro._1013;

public class demo6
{
    static void main()
    {
        Console.WriteLine("请输入菱形的行数（应为奇数）：");
        int n = Convert.ToInt32(Console.ReadLine());
        
        for (int i = 1; i <= n / 2 + 1; i++)
        {
            for (int j = 1; j <= n / 2 + 1 - i; j++)
            {
                Console.Write(" ");
            }
            for (int k = 1; k <= 2 * i - 1; k++)
            {
                Console.Write("*");
            }
            Console.WriteLine();
        }
        
        for (int i = n / 2; i >= 1; i--)
        {
            for (int j = 1; j <= n / 2 + 1 - i; j++)
            {
                Console.Write(" ");
            }
            for (int k = 1; k <= 2 * i - 1; k++)
            {
                Console.Write("*");
            }
            Console.WriteLine();
        }
    }
}
